package com.itheima.config;

import com.itheima.annotation.ConditionalOnClass;
import com.itheima.condition.OnClassCondition;
import com.itheima.pojo.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class UserConfig {
    @Bean
    @ConditionalOnClass(name = {"redis.clients.jedis.Jedis"})
    public User user() {
        User user = new User();
        user.setUsername("张三");
        return user;
    }
}
